package org.qtproject.example.NovaUI;

import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.content.Intent;
import android.view.View;
import android.util.Log;
import android.content.Intent;

public class MainActivity extends Activity {
    private boolean started = false;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        Log.e("onCreate","INIT");
        if(!started) {
            started = true;
            startService();
        }

        Intent j = new Intent(this, org.qtproject.qt5.android.bindings.QtActivity.class);
        j.setFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
        startActivity(j);
    }

    // Method to start the service
    public void startService() {
        startService(new Intent(getBaseContext(), MyService.class));
    }

    // Method to stop the service
    public void stopService() {
        stopService(new Intent(getBaseContext(), MyService.class));
    }
}
